﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Policy;

namespace ASPItalia.ModelVirtualCasting.Web.Utils
{
    public static class UrlExtensions
    {
        private static string baseImageUrlFormatString;

        static UrlExtensions()
        {
            baseImageUrlFormatString = Configuration.BaseImageUrl;
        }

        public static string ToThumbnailAbsoluteUrl(this string relativeUrl)
        {
            return VirtualPathUtility
                .ToAbsolute(string.Format(string.Format(baseImageUrlFormatString, "thumbs/" + relativeUrl)));
        }

        public static string ToAbsoluteUrl(this string relativeUrl)
        {
            return VirtualPathUtility
                .ToAbsolute(string.Format(string.Format(baseImageUrlFormatString, relativeUrl)));
        }
    }
}